/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.boxin.ims.modules.momarketing.entity;

import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.validator.constraints.Length;

import com.boxin.ims.modules.momarketing.entity.self.OnlineSignupDetail;
import com.thinkgem.jeesite.common.persistence.BaseEntity;
import com.thinkgem.jeesite.modules.sys.entity.User;

/**
 * 在线预约Entity
 * @author Jakemanse
 * @version 2013-09-10
 */
@Entity
@Table(name = "ims_online_signup")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class OnlineSignup extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private Long id; 		// 编号
	private User user; 		// 用户
	private Long memberId;//会员id
	private String wechatId;
	private String name; 	// 名称
	private String email;	//邮箱
	private String idno;	//身份证号
	private String mobile;	//手机号
	private String qq;		//QQ
	private OnlineSignupConfig onlineSignupConfig;
	
	
	private Date startTime;
	private Date endTime;
	private String remarks; // 备注
	private Date createTime;	// 创建日期
	private String delFlag;	// 删除标记（0：正常；1：删除）
	
	
	@Transient
	private List<OnlineSignupDetail> onlineSignupDetailList;
	
	
	
	
	
	

	@Transient
	public List<OnlineSignupDetail> getOnlineSignupDetailList() {
		return onlineSignupDetailList;
	}

	public void setOnlineSignupDetailList(
			List<OnlineSignupDetail> onlineSignupDetailList) {
		this.onlineSignupDetailList = onlineSignupDetailList;
	}

	public OnlineSignup() {
		this.createTime = new Date();
		this.delFlag = DEL_FLAG_NORMAL;
	}

	public OnlineSignup(Long id){
		this();
		this.id = id;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	//@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_momarketing_onlineSignup")
	//@SequenceGenerator(name = "seq_momarketing_onlineSignup", sequenceName = "seq_momarketing_onlineSignup")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne
	@JoinColumn(name="user_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	@Length(min=1, max=200)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Length(min=0, max=255)
	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	

	@Length(min=1, max=1)
	public String getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getIdno() {
		return idno;
	}

	public void setIdno(String idno) {
		this.idno = idno;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	
	@ManyToOne
	@JoinColumn(name="signup_config_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	public OnlineSignupConfig getOnlineSignupConfig() {
		return onlineSignupConfig;
	}

	public void setOnlineSignupConfig(OnlineSignupConfig onlineSignupConfig) {
		this.onlineSignupConfig = onlineSignupConfig;
	}

	public Long getMemberId() {
		return memberId;
	}

	public void setMemberId(Long memberId) {
		this.memberId = memberId;
	}

	public String getWechatId() {
		return wechatId;
	}

	public void setWechatId(String wechatId) {
		this.wechatId = wechatId;
	}
	
	
	
}


